﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Wjs.Controllers
{
    public class TreeNodesTestController : Controller
    {
        //
        // GET: /GetTreeNodesTest/

        public ActionResult GetChildrenNodes(string type, int id)
        {
            if (type == "root")
            {
                return Json(new object []
                {
                    new 
                    {
                        text = "Type 1",
                        collapsedIconClass = "type1-collapsed-icon",
                        expandedIconClass = "type1-expanded-icon",
                        value = new 
                        {
                            type = "type1",
                            id = 1
                        },
                        items = new object []{}
                    },
                    new 
                    {
                        content = @"<span style=""color: red;"">Type 2</span>",
                        value = new 
                        {
                            type = "type2",
                            id = 2
                        },
                        items = new object []{}
                    },
                    new 
                    {
                        text = "Type 3",
                        value = new 
                        {
                            type = "type3",
                            id = 3
                        },
                        items = new object []{}
                    }
                }, 
                JsonRequestBehavior.AllowGet);
            }

            return null;
        }

    }
}
